import 'package:flutter/material.dart';
import 'package:flutter_aggregate/model/plant/components/my_bottom_nav_bar.dart';
import 'package:flutter_aggregate/model/plant/constants.dart';
import 'package:flutter_aggregate/model/plant/screens/home/components/body.dart';
import 'package:flutter_svg/svg.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    double statusHeight = MediaQuery.of(context).padding.top;
    Size size = MediaQuery.of(context).size;
    return Scaffold(
      body: Stack(
        children: [
          const Body(),
          buildAppBar(size.width, statusHeight)
        ],
      ),
      bottomNavigationBar: const MyBottomNavBar(),
    );
  }

  Container buildAppBar(width, double statusHeight) {
    return Container(
      color: palntKPrimaryColor,
      width: width,
      height: palntKDefaultAppBarHeigth + statusHeight,
      alignment: Alignment.centerLeft,
      padding: EdgeInsets.only(
        left: palntKDefaultPadding,
        right: palntKDefaultPadding,
        top: statusHeight
      ),
      child: IconButton(
        onPressed: () {}, 
        icon: SvgPicture.asset('assets/plant/icons/menu.svg')
      ),
    );
  }
}